package com.liqy.huoshan.model;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.liqy.huoshan.R;
import com.liqy.huoshan.api.net.RetrofitHelper;
import com.liqy.huoshan.api.net.rx.RxSchedulers;
import com.liqy.huoshan.entity.HttpResult;
import com.liqy.huoshan.entity.HttpResultExtra;
import com.liqy.huoshan.entity.LiveExtra;
import com.liqy.huoshan.entity.LiveFeed;
import com.liqy.huoshan.entity.Splash;
import com.liqy.huoshan.model.home.HomeLiveFragment;

import java.util.ArrayList;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

/**
 * 第一个页面
 */
public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


//        RetrofitHelper.getHuoShanAPI().liveFeed()
//                .compose(RxSchedulers.<HttpResultExtra<ArrayList<LiveFeed>, LiveExtra>>io_main())
//                .subscribe(new Consumer<HttpResultExtra<ArrayList<LiveFeed>, LiveExtra>>() {
//                    @Override
//                    public void accept(HttpResultExtra<ArrayList<LiveFeed>, LiveExtra> resultExtra) throws Exception {
//
//                        Log.d(getLocalClassName(), resultExtra.toString());
//
//                    }
//                });

        getSupportFragmentManager()
                .beginTransaction()
                .add(R.id.content, HomeLiveFragment.newInstance("",""))
        .commit();
    }

    /**
     * 直播
     */
    public void live() {

    }

    /**
     * 小视频功能
     */
    public void video() {

    }
}
